fix(web): restore empty-query skill discovery#353
Open
codeblackhole1024 wants to merge 1 commit intoiflytek:mainfrom
Open
fix(web): restore empty-query skill discovery#353codeblackhole1024 wants to merge 1 commit intoiflytek:mainfrom
codeblackhole1024 wants to merge 1 commit intoiflytek:mainfrom
Conversation
|
|
dongmucat
reviewed
Apr 29, 2026
Collaborator
dongmucat
left a comment
There was a problem hiding this comment.
改动方向没问题,空查询不发 q 参数更干净,后端对 q= 和不传 q 的处理也是等价的(PostgresFullTextQueryService.normalizeKeyword 对 null 和空串都返回 null,走 discovery 逻辑)。
但有一个需要同步处理的地方:
E2E 断言和实现冲突
web/e2e/search-page-full.spec.ts 的 TC_SEARCH_INPUT_003(L44-58)还在等待一个必须包含空 q 的请求:
return response.status() === 200
&& url.searchParams.has('q')
&& url.searchParams.get('q') === ''这次改动之后 buildSkillSearchUrl({ q: '' }) 不再发送 q 参数,这个 E2E 用例会超时失败。
建议把这个断言改成验证"空查询仍然能拿到 discovery 结果"的用户可见行为,而不是钉死请求里必须带空 q。比如只检查请求命中了 /api/web/skills 且不包含非空 q,然后断言页面上有 skill card 渲染出来就行。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification